package step1_homework4_01;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import java.util.Scanner;

public class Student_add  {

    public static List stu_add(List list) throws IdException, AgeException {
        Scanner sc = new Scanner(System.in);
        Student stu = new Student();
        System.out.print("请输入要添加的id :");
        Integer id = sc.nextInt();
        System.out.print("请输入要添加的name :");
        String name = sc.next();
        System.out.print("请输入要添加的age :");
        Integer age = sc.nextInt();
        stu.setId(id);
        stu.setName(name);
        stu.setAge(age);
        list.add(stu);
        System.out.println(list);
        return list;

    }



}